import Vue from 'vue'
import VueRouter from 'vue-router'
const Home = () => import('views/home/home')
const Category = () => import('views/category/category.vue')
const Cart = () => import('views/cart/Cart')
const Profile = () => import('views/profile/profile')
const detail= () => import('views/detail/detail')
Vue.use(VueRouter)
//获取原型对象上的push函数


const routes = [
  {
    path: '/',
    redirect: '/home'
  },
  {
    path: '/home',
    component: Home
  },
  {
    path: '/category',
    component: Category
  },
  {
    path: '/cart',
    component: Cart
  },
  {
    path: '/profile',
    component: Profile
  },
  {
    name: "detail",
    path: "/detail/:iid",
    component: detail
  }
]

const router = new VueRouter({
  routes
})



export default router
